<template>
    <div class="xiao">
      <center><h1>钱包变更列表</h1></center>
      类型：
      <el-select v-model="from.type" placeholder="请选择">
        <el-option


          label="充值"
          value="充值">
        </el-option>
        <el-option


          label="消费"
          value="消费">
        </el-option>
      </el-select>
      时间：<el-date-picker
      v-model="from.start"
      type="date"
      placeholder="选择日期">
    </el-date-picker>
      ——
      <el-date-picker
        v-model="from.end"
        type="date"
        placeholder="选择日期">
      </el-date-picker>
      <el-button type="primary" @click="initData">查询</el-button>
      <el-table
        :data="pageInfo.list"
        style="width: 100%">
        <el-table-column
          prop="id"
          label="编号"
        >
        </el-table-column>
        <el-table-column
          prop="type"
          label="类型"
        >
        </el-table-column>
        <el-table-column
          prop="cmoney"
          label="金额">
        </el-table-column>

        <el-table-column
          prop="bmoney"
          label="变更前金额">
        </el-table-column>
        <el-table-column
          prop="hmoney"
          label="变更后金额">
        </el-table-column>
        <el-table-column
          prop="createtime"
          label="时间">
        </el-table-column>
      </el-table>
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="pageInfo.pageNum"
        :page-sizes="[2, 200, 300, 400]"
        :page-size="pageInfo.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="pageInfo.total">
      </el-pagination>
    </div>
</template>

<script>
    export default {
        name: "Xiao",
      data(){
          return{
            pageInfo:{},
            froms:{
              pageNum:1,
              pageSize:2,
            },
            from:{
              type:"",
              start:"",
              end:"",
            },
          }
      },
      methods:{
        handleSizeChange(val){
          this.froms.pageSize=val;
          this.initData();
        },
        handleCurrentChange(val){
          this.froms.pageNum=val;
          this.initData();
        },
        initData(){
          this.axios.post(`http://localhost:9001/api/log/findAll?pageNum=${this.froms.pageNum}&pageSize=${this.froms.pageSize}`,this.from).then(res=>{
            this.pageInfo=res.data;
          })
        }
      },
      created(){
this.initData();
      }
    }
</script>

<style scoped>

</style>
